﻿@inject CoolCat.Core.Contracts.ISystemManager SystemManager
@using CoolCat.Core.Mvc.Extensions;
@{
    var contexts = CoolCat.Core.PluginsLoadContexts.All();
    var menus = contexts.SelectMany(p => p.GetPages()).ToList();

}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"] - CoolCat</title>


    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />

    <environment exclude="Development">
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
              asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
              asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute"
              crossorigin="anonymous"
              integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" />
    </environment>
    <link rel="stylesheet" href="~/css/site.css" />
    <link rel="stylesheet" href="@Url.Action("GetSiteCSS", "Common")" />
    <link href="~/lib/bootstrap/dist/css/bootstrap-datepicker.min.css" rel="stylesheet" />
    @RenderSection("Header", required: false)
</head>
<body>
    <header>
        <nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
            <div class="container">

                <a class="navbar-brand" asp-area="Admin" asp-controller="Home" asp-action="Dashboard">
                    <img src="~/logo_small.png" width="45px" />
                    <span style="color: #5cbedf;">CoolCat</span>
                </a>

                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
                        aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
                    <ul class="navbar-nav flex-grow-1">
                        <li class="nav-item">
                            <a class="nav-link text-dark" asp-area="Admin" asp-controller="Home" asp-action="Dashboard">Home</a>
                        </li>
                        @if (SystemManager.CheckInstall())
                        {
                            <li class="dropdown">
                                <a class="nav-link text-dark dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">System<span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li class="nav-item">
                                        <a class="nav-link text-dark" asp-area="Admin" asp-controller="Plugins" asp-action="Assemblies">Assemblies</a>
                                    </li>
                                    <li>
                                        <a class="nav-link text-dark" asp-area="Admin" asp-controller="Plugins" asp-action="Index">Plugins</a>
                                    </li>
                                    <li>
                                        <a class="nav-link text-dark" asp-area="Admin" asp-controller="Plugins" asp-action="Document">Documentation</a>
                                    </li>
                                    <li>
                                        <a class="nav-link text-dark" asp-area="Admin" asp-controller="System" asp-action="SiteSettings">Site Settings</a>
                                    </li>

                                </ul>
                            </li>
                            <li>
                                <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Back</a>
                            </li>
                        }
                    </ul>
                </div>
            </div>
        </nav>
    </header>
    <div class="container">
        <main role="main" class="pb-3">
            @RenderBody()
        </main>
    </div>

    <footer class="border-top footer text-muted">
        <div class="container">
            <div class="footLeft">&copy; 2020 - CoolCat Framework v1.0.1</div>
            <div class="footRight"><img src="~/logo2.png" /></div>
        </div>
    </footer>

    <environment include="Development">
        <script src="~/lib/jquery/dist/jquery.js"></script>
        <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
    </environment>
    <environment exclude="Development">
        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
                asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
                asp-fallback-test="window.jQuery"
                crossorigin="anonymous"
                integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=">
        </script>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"
                asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"
                asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
                crossorigin="anonymous"
                integrity="sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o">
        </script>
    </environment>
    <script src="~/lib/bootstrap/dist/js/bootstrap-datepicker.min.js"></script>
    <script src="~/js/site.js" asp-append-version="true"></script>

    @RenderSection("Scripts", required: false)
</body>
</html>
